package com.cqw.commontest.thread;

import java.util.concurrent.*;

/**
 * @Author: caoqingwen
 * @CreateTime: 2021-09-16 16:02
 * @Description: 线程池测试1
 */
public class ThreadPoolTest1 {


    private static final ExecutorService executorService =
            new ThreadPoolExecutor(5, 10, 1L, TimeUnit.SECONDS, new ArrayBlockingQueue<>(100), new ThreadPoolExecutor.CallerRunsPolicy());


    public static void main(String[] args) {
        executorService.execute(() -> System.out.println("ABC"));
        Future<String> submit = executorService.submit(() -> "OK");


        try {
            String s = submit.get();
            System.out.println(s);
        } catch (InterruptedException e) {
            e.printStackTrace();
        } catch (ExecutionException e) {
            e.printStackTrace();
        }
        //master修改
        //uat修改
        //


    }


}
